<!doctype html>
<html>
<head>
<meta charset="utf-8">
    <title>会员资料</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">     
    <meta content="yes" name="apple-mobile-web-app-capable">     
    <meta content="black" name="apple-mobile-web-app-status-bar-style">     
    <meta content="telephone=no" name="format-detection">
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" type="text/css" href="/H5/css/sm.min.css" />
    <link rel="stylesheet" type="text/css" href="/H5/css/reset.css?v=1" />
</head>            
<body>
	<div class="page-group ms-controller" :controller="member">
        <div class="page page-current" style="background: #efeff4">
            <header class="bar bar-nav">
              	<a class="icon icon-left pull-left" href="javascript:window.history.go(-1);"></a>
              	<a class="icon icon-home pull-right" href="/H5"></a>
              	<h1 class="title">会员资料</h1>
            </header>
            <div class="content visibility">
    			<div class="list-block" style="background: #fff; margin: 0">
                	<div class="portrait"><a href="javascript:;"><img :attr="{'src': @data.avatar_url}" width="80" height="80" /></a></div>
                    <ul class="block-ul">
                        <li class="item-content" :for="($index, el) in @data | filterBy(@filter)">
                            <div class="item-inner">
                                <div class="item-title">{{@map[$index]}}</div>
                                <div class="item-after">{{el}}</div>
                            </div>
                        </li>
                    </ul>
    			</div>
                <div class="list-block">
                    <ul class="gray">
                      	<li class="item-content item-link" :on-click="@jump('/H5/password?type=1')">
	                        <div class="item-inner">
	                          	<div class="item-title">修改密码</div>
	                        </div>
                      	</li>
                      	<li class="item-content item-link" :on-click="@jump('/H5/memberperfect')">
                        	<div class="item-inner">
                          		<div class="item-title">完善会员资料</div>
                        	</div>
                      	</li>
                      	<li class="item-content item-link" :on-click="@jump('/H5/addresslist')">
                        	<div class="item-inner">
                          		<div class="item-title">管理收货地址</div>
                        	</div>
                      	</li>
                    </ul>
    			</div>
            </div>
        </div>
    </div>
<script type='text/javascript' src='/H5/js/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='/H5/js/sm.min.js' charset='utf-8'></script>
<script type='text/javascript' src='/H5/js/avalon.js' charset='utf-8'></script>
<script type='text/javascript' src='/H5/js/simpleStorage.js' charset='utf-8'></script>
<script type='text/javascript' src='/H5/js/mall.js' charset='utf-8'></script>
<script>
	var member = avalon.define({
		$id: "member",
		data: {},
		map: {
			username: "登录账号",
			real_name: "真实姓名",
			nickname: "会员昵称",
			sex_label: "性别",
			born: "出生日期",
			id_no: "身份证号	",
			mobile: "手机号码",
			area_label: "所在地区",
			address: "详细地址",
			email: "邮箱",
			bank_type_label: "开户行",
			bank_no: "银行卡号"
		},
		filter: function(e, k){
			if( e && member.map[k] ){
				return e 
			}
		},
		jump: function( url ){
			window.location.href = url;
		},
		getInfo: function(){
			Mall.request( "/api/UserInfo" )
				.always( function( data ){
					if( data.error_code == 0 ){
					    member.data = data.data;
                        $( ".content" ).removeClass( "visibility" );
					}
					else{
					    $.alert(data.error_msg);
					}
				} )
		},
	})
	member.getInfo();
	avalon.scan( document.body )
</script>
</body>
</html>